<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>进销管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../../public/css/font.css">
    <link rel="stylesheet" href="../../public/css/xadmin.css">
    <script src="../../public/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../public/js/xadmin.js"></script>
    <script>
        function convertTime(currentTime) {
            var time = new Date(currentTime);
            var year = time.getFullYear();
            var month = time.getMonth() + 1;
            if (month < 10) {
                month = "0" + month;
            }
            var day = time.getDate();
            if (day < 10) {
                day = "0" + day;
            }
            var date = year + "-" + month + "-" + day;
            return date;
        }
    </script>
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a>
                    <cite>订单列表</cite>
                </a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn layui-btn-lg layui-btn-normal"
                            onclick="xadmin.open('添加订单','order-add.html',800,600)">
                        <i class="layui-icon"></i>添加
                    </button>
                </div>
                <div style="height: 10px" class="layui-card-body">
                    <h2 style="color: gray">今日销售</h2>
                </div>
                <div class="layui-card-body">

                    <table class="layui-table"
                           lay-data="{url:'/sale/getTodaySale',page:true,toolbar: '#toolbarDemo',id:'test'}"
                           lay-filter="test">
                        <thead>
                        <tr>
                            <th lay-data="{type:'checkbox'}">ID</th>
                            <th lay-data="{field:'sid', width:80, sort: true}">ID</th>
                            <th lay-data="{field:'count',width:80}">数量</th>
                            <th lay-data="{field:'totalPrice',width:100}">总价</th>
                            <th lay-data="{field:'saleDate',width:130,templet:function(row){return convertTime(row.saleDate);}}">
                                销售日期
                            </th>
                            <th lay-data="{field:'realName'}">销售员</th>
                            <th lay-data="{field:'productName'}">产品名称</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate', 'form'],
        function () {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });
    layui.use('table', function () {
        var table = layui.table;

        table.render();
    })
</script>

</html>